import React, { useEffect } from 'react';
import { connect } from 'umi';
import { Card, Spin } from 'antd';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
// import logo from '@/assets/logo.png';
import { withRoutePage } from '@/utils/enhanceUtils';
import OrgTree from '@/pages/Organization/OrgFlow/OrgTree';
import { eventTrack } from '@/utils/track';
import styles from './View.less';

const Views = () => {
    useEffect(() => {
        eventTrack({
            eventName: 'personnel_management_organization_view_click',
            pageName: 'personnel_management_organization'
        });
    }, [])
    return (
        <PageHeaderWrapper type="success">
            <Spin spinning={false}>
                <Card className={styles.orgCard}>
                    <OrgTree
                        control={false}
                        showViewModeSwitch
                        type="organization"
                        orgTreeId={`organizationReadOnly_${Math.floor(Math.random() * 1000000)}`}
                    />
                </Card>
            </Spin>
        </PageHeaderWrapper>
    )
};

export default withRoutePage(connect()(Views));
